#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N = 4e5 + 10;
typedef pair<int, int> PII;
struct node {
    int a, b, c, idx;
} e[N], ue[N];
bool cmp(node a, node b) { return a.c < b.c; }
map<int, int> mp;
int fa[N];
int n, m, q;
int find(int x) {
    if (fa[x] != x) fa[x] = find(fa[x]);
    return fa[x];
}
signed main() {
    cin >> n >> m >> q;
    for (int i = 0; i < m; i++) {
        cin >> e[i].a >> e[i].b >> e[i].c;
        e[i].idx = 0;
    }
    for (int i = 0; i < q; i++) {
        cin >> ue[i].a >> ue[i].b >> ue[i].c;
        ue[i].idx = i;
        e[m + i] = ue[i];
        e[m + i].idx = i + 1;
    }
    sort(e, e + m + q, cmp);

    for (int i = 0; i < N; i++) {
        fa[i] = i;
    }

    int res = 0;
    for (int i = 0; i < m + q; i++) {
        int a = e[i].a, b = e[i].b;
        int c = e[i].c;
        a = find(a), b = find(b);
        if (a != b) {
            if (e[i].idx) {
                mp[e[i].idx - 1] = 1;
            } else {
                fa[a] = b;
            }
        }
    }

    for (int i = 0; i < q; i++) {
        int a = e[i].a, b = e[i].b;
        int c = e[i].c;
        if (mp[ue[i].idx]) {
            puts("Yes");
        } else {
            puts("No");
        }
    }
}